As hardware for reproducing and storing high resolution or high quality video content is being developed and supplied, a need for a video codec for effectively encoding or decoding the high resolution or high quality video content is increasing. In a conventional video codec, a video is encoded according to a limited encoding method based on a macroblock having a predetermined size.
Image data in a spatial domain is transformed to coefficients in a frequency domain by using frequency transformation. A video codec encodes frequency coefficients according to block units by splitting image data into blocks having a predetermined size and performing Discrete Cosine Transform (DCT) transformation on each block to quickly compute the frequency transformation. The coefficients in the frequency domain are more easily compressed than the image data in the spatial domain. Specifically, since an image pixel value of the spatial domain is expressed as a prediction error by inter prediction or intra prediction of the video codec, when the frequency transformation is performed on the prediction error, a substantial amount of data may be transformed to 0. The video codec saves a data amount by replacing repeatedly generated data with data having a small size.